package com.nine.shop.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nine.shop.mapper.TypeMapper;
import com.nine.shop.mapper.UserMapper;
import com.nine.shop.model.Type;
import com.nine.shop.model.User;
import org.springframework.stereotype.Service;

/**
 * @author hty
 * Create on 2019/8/17
 */
@Service
public class TypeService extends ServiceImpl<TypeMapper, Type> {
    public Type findByTypeId(Integer typeId) {
        return baseMapper.selectOne(new QueryWrapper<Type>().eq("id", typeId));
    }
    public Integer findByTypeName(String typeName){
        return baseMapper.selectCount(new QueryWrapper<Type>().eq("name",typeName) );
    }
}
